package com.tuananh.radnom.protocolservice;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Observable;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;

import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorNode;

import com.tuananh.radnom.model.iputils.IPRange;

@XmlDiscriminatorNode("@class")
public abstract class AbstractDiscover extends Observable{
	boolean broadcast;
	@XmlAttribute
	public boolean isBroadcast() {
		return broadcast;
	}

	public void setBroadcast(boolean broadcast) {
		this.broadcast = broadcast;
	}
	String inputIPs;
	
	@XmlElement(name="input")
	public String getInputIPs() {
		return inputIPs;
	}

	public void setInputIPs(String inputIPs) {
		this.inputIPs = inputIPs;
	}
	String broadcastConfig;
	@XmlElement(name="broadcast-input")
	public String getBroadcastConfig() {
		return broadcastConfig;
	}

	public void setBroadcastConfig(String broadcastConfig) {
		this.broadcastConfig = broadcastConfig;
	}
	ArrayList<IPRange> range;
	@XmlElementWrapper(name="config")
	@XmlElement(name="range")
	public ArrayList<IPRange> getRange() {
		return range;
	}
	public void setRange(ArrayList<IPRange> range) {
		this.range = range;
	}
	public abstract ArrayList<String> broadcastDiscover(ArrayList<String> broadcastIPs);
	public abstract ArrayList<String> discoverNetInt(ArrayList<String> inputIPs);
	public abstract HashMap<String,String> discoverType(ArrayList<String> discoveredIPs);
	public abstract HashMap<String,String> discoverConnection(ArrayList<String> inputIPs);
}
